package com.hp.activiti.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.hp.activiti.model.RoleInfo;

/**
 * @Description:
 * @author hp
 * @date 2018年5月20日 上午9:04:00
 */
@Repository
public interface RoleRepository extends JpaRepository<RoleInfo, Long>{

	@Query(value="select r.* from user_role_relation ur,role r where ur.roleId=r.id and ur.userId=?1",nativeQuery=true)
	public List<RoleInfo> findByUserId(Long id);

}
